/**
 * 
 */
package com.dovgopoly.carlogbook.common.mvp;

import com.mvp4g.client.event.EventBus;
import com.mvp4g.client.presenter.BasePresenter;

/**
 * @author Zhenya
 * 
 */
public abstract class AbstractPresenter<V extends IView<P>, P extends IPresenter, E extends EventBus> extends
		BasePresenter<V, E> {
	/**
	 * Returns a reference to the presenter of a concrete type. Every
	 * implementation class has to implement this method with its
	 * <code>Presenter</code> type.
	 * 
	 * @return a reference to the presenter
	 */
	protected abstract P getPresenter();

	/**
	 * Injects the presenter reference into the view during the presenter's
	 * binding phase. An override method in a subclass has to call the
	 * overridden super method.
	 */
	@Override
	public void bind() {
		super.bind();
		view.setPresenter(getPresenter());
	}
}
